package com.kingdomai.testdb;

import com.alibaba.druid.sql.ast.statement.SQLColumnDefinition;
import com.alibaba.druid.sql.ast.statement.SQLCreateTableStatement;
import com.alibaba.druid.sql.ast.statement.SQLPrimaryKey;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

/**
 * @author yangzhixiao
 */
public class DataTable {
    private String tableName;
    private SQLCreateTableStatement metaStatement;
    private SQLPrimaryKey primaryKey;
    private List<SQLColumnDefinition> columnDefinitions;
    private final TreeMap<String, Map<String, Object>> rows = new TreeMap<>();

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public SQLCreateTableStatement getMetaStatement() {
        return metaStatement;
    }

    public void setMetaStatement(SQLCreateTableStatement metaStatement) {
        this.metaStatement = metaStatement;
    }

    public SQLPrimaryKey getPrimaryKey() {
        return primaryKey;
    }

    public void setPrimaryKey(SQLPrimaryKey primaryKey) {
        this.primaryKey = primaryKey;
    }

    public List<SQLColumnDefinition> getColumnDefinitions() {
        return columnDefinitions;
    }

    public void setColumnDefinitions(List<SQLColumnDefinition> columnDefinitions) {
        this.columnDefinitions = columnDefinitions;
    }

    public Map<String, Map<String, Object>> getRows() {
        return rows;
    }
}
